package com.atguigu.tingshu.album.client;

import com.atguigu.tingshu.album.client.impl.AlbumInfoDegradeFeignClient;
import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.album.AlbumAttributeValue;
import com.atguigu.tingshu.model.album.AlbumInfo;
import com.atguigu.tingshu.model.album.AlbumStat;
import com.atguigu.tingshu.model.search.AttributeValueIndex;
import com.atguigu.tingshu.vo.album.AlbumInfoVo;
import com.atguigu.tingshu.vo.album.AlbumListVo;
import com.atguigu.tingshu.vo.album.AlbumStatVo;
import com.atguigu.tingshu.vo.search.AlbumInfoIndexVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.BeanUtils;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * <p>
 * 产品列表API接口
 * </p>
 *
 * @author qy
 */
// api/album/albumInfo
// getAlbumInfoIndexPage/{pageNum}/{pageSize}
@FeignClient(value = "service-album", fallback = AlbumInfoDegradeFeignClient.class)
public interface AlbumInfoFeignClient {

    @GetMapping("api/album/albumInfo/getAlbumInfoIndexPage/{pageNum}/{pageSize}")
    public Result<Page<AlbumListVo>> getAlbumInfoIndexPage(
            @PathVariable("pageNum") Long pageNum,
            @PathVariable("pageSize") Long pageSize
    );
    // 远程调用 根据专辑id获取专辑属性信息
    // api/album/albumInfo/findAttributesByAlbumId/{id}
    @GetMapping("api/album/albumInfo/findAttributesByAlbumId/{id}")
    public Result<List<AttributeValueIndex>> findAttributesByAlbumId(@PathVariable("id") Long id);
    // 远程调用 根据专辑id获取专辑信息
    // api/album/albumInfo/getAlbumInfoById/{id}
    @GetMapping("api/album/albumInfo/getAlbumInfoById/{id}")
    public Result<AlbumListVo> getAlbumInfoById(@PathVariable("id") Long id);

    // api/album/albumInfo/getAlbumInfo/{id}
    @GetMapping("api/album/albumInfo/getAlbumInfo2/{id}")
    public Result<AlbumInfo> getAlbumInfoById2(@PathVariable("id") Long id);

    // 远程调用 根据专辑id获取专辑的统计数据
    // api/album/albumInfo/getAlbumStatistics/{id}
    @GetMapping("api/album/albumInfo/getAlbumStatistics/{id}")
    public Result<AlbumStatVo> getAlbumStatVo(@PathVariable("id") Long id);
}